In the previous video,
we looked at training a small data set of
cats versus dogs, and saw how overfitting occurred relatively early on
in the training, leading us to
a false sense of security about how well the neural
network could perform. Let's now take a look
at the impact of adding image augmentation
to the training. Here we have exactly
the same code except that we've added the image
augmentation code to it. I'll start the training,
and we'll see that we have 2,000 training images
in two classes. As we start training, we'll initially see
that the accuracy is lower than with the non-augmented
version we did earlier. This is because of
the random effects of the different image processing
that's being done. As it runs for a few more epochs, you'll see the accuracy
slowly climbing. I'll skip forward to see
the last few epochs, and by the time we
reach the last one, our model's about 86 percent accurate on the training data, and about 81 percent
on the test data. So let's plot this. We can see that the training
and validation accuracy, and loss are actually in
step with each other. This is a clear sign that we've solved the overfitting
that we had earlier. While our accuracy
is a little lower, it's also trending upwards so perhaps a more epochs will
get us closer to 100 percent. Why don't you go ahead
and give it a try?